<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>show_students</title>
</head>
<body>
{% block func %}
    <a href="{% url "app1:collect_student_info" %}">添加学生信息</a>
    <br>
    <form action="{% url "app1:query_student" %}" method="post">
        {% csrf_token %}
        <input type="text" name="queryname" placeholder="学生姓名">
        <input type="submit" value="搜索">
    </form>
{% endblock %}

{% block showstudent %}
    {% for student in students %}
        学生姓名:{{ student.name }} &nbsp;&nbsp;
        学生年龄:{{ student.age }} &nbsp;&nbsp;
        {#    学生性别:{{ student.get_gender_display }} &nbsp;&nbsp;#}
        {#    学生电话:{{ student.phone }} &nbsp;&nbsp;#}
        {#    <a href="{% url "app1:student" student.id %}">查看</a>#}
        <a href="{% url "app1:student2" %}?id={{ student.id }}">查看</a>
        &nbsp;&nbsp;
        {#    <a href="{% url "app1:del_student" student.id %}">删除</a>#}
        <a href="{% url "app1:del_student2" %}?id={{ student.id }}">删除</a>
        <a href="{% url "app1:update_student" %}?id={{ student.id }}">修改</a>
        <br>
    {% endfor %}

{% endblock %}

{% block footer %}
    {% if curpage > 1 %}
        <a href="{% url "app1:show_students" %}?page={{ curpage|add:-1 }}&page_size={{ page_size }}">上一页</a>
    {% endif %}
    当前页{{ curpage }}
    {% if curpage < max_page %}
        <a href="{% url "app1:show_students" %}?page={{ curpage|add:1 }}&page_size={{ page_size }}">下一页</a>
    {% endif %}
{% endblock %}

</body>
</html>